﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteSearch.Master" AutoEventWireup="true" CodeBehind="AdminAgenda.aspx.cs" Inherits="SACM.PageConsultorio.AdminAgenda" %>
<%@ MasterType VirtualPath="~/SiteSearch.Master" %>
<%@ Register TagPrefix="uc" TagName="ToolBar" Src="~/Controls/ToolBar.ascx" %>
<asp:Content ID="cont1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src="../Scripts/PageAdminAgenda.js"></script>
</asp:Content>

<asp:Content ID="cont2" ContentPlaceHolderID="cphFilter" runat="server">
 <table>
        <tr>
            <td class="tdEtiqueta">
                Paciente:
            </td>
            <td class="tdCampo">
                <ganda:ComboBox ID="CmbPaciente" runat="server" Width="300px" EnabledValidator="false"
                        CssClass="WindowsStyle" />
            </td>       
           
             <td class="tdEtiqueta">
                Fecha:
            </td>            

                <td class="tdCampo renglon">
                    <ganda:DatePicker ID="TxtFecha" runat="server" Enabled="true" Width="90px" EnabledValidator="false" CssClass="textbox" />
                </td>
        
        
        </tr>
        <tr>            
                 <td class="tdEtiqueta renglon">
                    Doctor:
                </td>
                <td class="tdCampo renglon">
                    <ganda:ComboBox ID="cmbDoc" runat="server" Width="300px" EnabledValidator="false"
                        CssClass="WindowsStyle" />
                 </td>
        </tr>
    </table>
      
    <div class="btnBusar">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Button ID="btnBuscar" runat="server" Text="Buscar" CssClass="boton" OnClick="BtnBuscar_Click"/>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="cphContent" runat="server">
 <uc:ToolBar runat="server" id="toolbar" />
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <ganda:GridView ID="gridAgenda" runat="server" AutoGenerateColumns="False" DataKeyNames="IdPaciente"
               AllowPaging="True" onrowcommand="gridAgenda_RowCommand" AllowScroll="true" OnPageIndexChanging="gridAgenda_PageIndexChanging">
                <PagerSettings Mode="NextPreviousFirstLast" Position="Top"/>
                <Columns>

                  <asp:TemplateField HeaderText="Acciones" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <%--<asp:Button ID="BtnMod" CssClass="btnMod" runat="server" Text="" CommandName="cmdModificar" CommandArgument='<%#Eval("IdDoctor") + "," + Container.DataItemIndex %>' />--%>
                            <asp:Button ID="BtnMod" CssClass="btnMod" runat="server" Text="" CommandName="cmdModificar" Params='<%#Eval("IdPaciente") + "," + Container.DataItemIndex %>' OnClientClick="return EditRegistro(this);" ToolTip="Editar" />
                            <ganda:Button ID="BtnDel" CssClass="btnDel" runat="server" Text="" Params='<%#Eval("IdPaciente") + "," + Container.DataItemIndex %>' OnClientClick="return Elimina(this);" ToolTip="Eliminar" />
                        </ItemTemplate>
                        <ItemStyle Width="80px" />  
                    </asp:TemplateField>


                    <asp:BoundField DataField="IdCita" HeaderText="IdCita" SortExpression="IdCita" ItemStyle-Width="100px" Visible="false">
                    </asp:BoundField>

                    <asp:BoundField DataField="IdPaciente" HeaderText="IdPaciente" SortExpression="IdPaciente" ItemStyle-Width="100px" Visible="false">
                    </asp:BoundField>

                    <asp:BoundField DataField="IdDoctor" HeaderText="IdDoctor" SortExpression="IdDoctor" ItemStyle-Width="100px" Visible="false">
                    </asp:BoundField>

                    <asp:BoundField DataField="FechaCita" HeaderText="Fecha" SortExpression="Fecha" ItemStyle-Width="70px">
                    </asp:BoundField>

                    <asp:BoundField DataField="HoraCita" HeaderText="Hora" SortExpression="Hora" ItemStyle-Width="80px">
                    </asp:BoundField>
                  
                    <asp:BoundField DataField="NombrePaciente" HeaderText="Paciente" SortExpression="Paciente" ItemStyle-Width="250px">
                    </asp:BoundField>

                    <asp:BoundField DataField="NombreDoctor" HeaderText="Doctor" SortExpression="Doctor" ItemStyle-Width="250px">
                    </asp:BoundField>
                  
                    <asp:BoundField DataField="DescEstatusCita" HeaderText="Estatus" SortExpression="Estatus" ItemStyle-Width="80px">
                    </asp:BoundField>
                   
                  
                </Columns>
            </ganda:GridView>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="toolbar" />
        </Triggers>
    </asp:UpdatePanel>

       <div style="display: none;">
        <asp:UpdatePanel runat="server" ID="updhidden">
            <ContentTemplate>
                <asp:HiddenField ID="hdnId" runat="server" />
                <asp:Button ID="btnElimina" runat="server" OnClick="btnElimina_Click" CausesValidation="false" />
            </ContentTemplate>  
        </asp:UpdatePanel>
    </div>

      <script type="text/javascript">
        var btnBuscar = '<%=btnBuscar.ClientID %>';
        var hdnId = '<%=hdnId.ClientID %>';
        var btnElimina = '<%=btnElimina.ClientID %>';
      
    </script>
    

   
</asp:Content>
                